/**
 * Created by zhulingxiao on 2017/6/8.
 */
import { MODAL_OPEN,MODAL_CLOSE } from '../actions/modal'

const initialState = { visible : false };

const modal = (state = initialState, action) => {

    switch (action.type) {

        case MODAL_OPEN:
            return Object.assign({}, state, {
                visible: true
            });
        case MODAL_CLOSE:
            return Object.assign({}, state, {
                visible: false
            });

        default:
            return state
    }

};

export default modal
